package com.yz.dba.service;

import com.yz.dba.mapper.TaskCountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 段成
 * @date 2019/12/3 - 20:23
 */
@Service
public class TaskCountService {

    @Autowired
    private TaskCountMapper taskCountMapper;

    public int queryTaskCount(String taskId){
        return taskCountMapper.queryTaskCount(taskId);
    }

    @Transactional
    public void initializeTaskCount(String taskId) {
        taskCountMapper.delTaskCount(taskId);
        taskCountMapper.addTaskCount(taskId);
    }

    public void updateThreadCount(String taskId,int ModifyValue){
        taskCountMapper.updateThreadCount(taskId,ModifyValue);
    }


}
